export default G6 => {
  G6.registerBehavior('drag-base-edge', {
    getDefaultCfg() {
      return {

      }
    },
    getEvents() {
      return {
        'edge:dblclick': 'onEdgeDblclick'
      }
    },
    shouldBegin(e) {
      return true
    },
    onEdgeDblclick(e) {
      // 2022年4月29日10:56:44
      // console.log(e, this.graph)
      const item = e.item
      const source = item.getSource()
      const target = item.getTarget()

      this.graph.removeItem(item)

      this.graph.emit('before-edge-add', {
        source: source,
        type: 'polyline-edge',
        target: target
      })
      // const group = item.getGroup()
      // item.remove()
      // this.graph.removeItem(item)
      // console.log(group.getItem("dashed-line"))
    }
  })
}
